#!/bin/sh

function scrapy(){
    count=`ps -ef |grep "mysqld" |grep -v "grep" |wc -l`

    echo $count
    if [ 0 == $count ];then
        /etc/init.d/mysqld start
    fi
}

scrapy